package com.example.searchservice.controller;


import com.example.bean.Orders;
import com.example.searchservice.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/search")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("amount/{id}")
    public List<Orders> getOrderAmount(@PathVariable("id") Integer id) {
        return this.orderService.getOrderAmount(id);
    }

    @GetMapping("state/{id}")
    public List<Orders> getOrderState(@PathVariable("id") Integer id) {
        return this.orderService.getOrderState(id);
    }
}
